package org.iblink.gui.swing.views.component;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;

import org.iblink.gui.swing.actions.AssetAction;
import org.iblink.gui.swing.actions.CategoryAction;

public class IBlinkMenuBar extends JMenuBar {

  /**
   * Generated serial version UID
   */
  private static final long serialVersionUID = 7520981438362819429L;

  public IBlinkMenuBar() {
    JMenu menu = new JMenu("IBlink");
    JMenuItem item = new JMenuItem(new AbstractAction("Exit") {
      private static final long serialVersionUID = -1928150431148789480L;

      @Override
      public void actionPerformed(ActionEvent e) {
        System.exit(0);
      }
    });
    menu.add(item);
    
    add(menu);
    
    menu = new JMenu("Category");
    JMenuItem menuItem;
    menuItem = new JMenuItem(CategoryAction.getRenameCategoryAction());
    menu.add(menuItem);
    menuItem = new JMenuItem(CategoryAction.getAddChildCategoryAction());
    menu.add(menuItem);
    menuItem = new JMenuItem(CategoryAction.getAddSiblingCategoryAction());
    menu.add(menuItem);
    menuItem = new JMenuItem(CategoryAction.getDeleteCategoryAction());
    menu.add(menuItem);
    
    add(menu);
    
    menu = new JMenu("Asset");
    menuItem = new JMenuItem(AssetAction.getAddAssetAction());
    menu.add(menuItem);
    menuItem = new JMenuItem(AssetAction.getDelAssetAction());
    menu.add(menuItem);
    menuItem = new JMenuItem(AssetAction.getOpenAssetAction());
    menu.add(menuItem);
    menuItem = new JMenuItem(AssetAction.getEditAssetAction());
    menu.add(menuItem);
    
    add(menu);
  }
}
